import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/views/Layout/index.vue'
import Home from '@/views/Home/index.vue'
import Detail from "@/views/Detail/index.vue";
import Checkout from "@/views/Checkout/index.vue";
// import Pay from "@/views/Pay/index.vue";
// import PayBack from "@/views/Pay/PayBack.vue";
import Cart from "@/views/Cart/index.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { 
      path: '/',
      name: 'layout',
      component: Layout,
      children: [
        { 
          path: '',
          name: 'home',
          component: Home
        },{
          path: "/detail/:id",
          component: Detail,
        },     {
          path: "/checkout",
          component: Checkout,
       },{
          path: "cart",
          component: Cart,
        },
      ] 
    },

    {
      path: '/login',
      name: 'Login',
      component: () => import('@/views/Login/index.vue')
    },
      {
      path: '/regist',
      name: 'Register',
      component: () => import('@/views/Register/index.vue')

    },
    
    //  {
    //       path: "/pay",
    //       component: Pay,
    //    },
    //   {
    //       path: '/paycallback',
    //       component: PayBack
    //     },
  ]
})

export default router
